Skip to main content

initialize

Create an object from Predis.ai SDK.

Usage

const predis = new window.Predis();
predis.initialize({
appId: "YOUR_APP_ID",
embedToken: "SSO_TOKEN", // optional, to enable SSO
customAssets: [{ url: "some_image_url" }], // optional, to pass images inside the Predis.ai post generator
mode: window.Predis.modes.SIMPLE //to define if you want the detailed more or minimal mode,
brandDetails: {
name: "Your Brand Name",
logo_url: "https://predis.ai/assets/img/predis_logo-min.webp",
brand_hashtags: "#preidsai",
brand_website: "somewebsite.ai",
brand_handle: "@predisai",
brand_colors: ["#296bd6", "#ff71ab"]
},
show_onboarding: true, // whether to show onboarding screen for a new user
whiteLabelLogo: "https://predis.ai/assets/img/predis_logo-min.webp"
});

Parameters

NameDescriptionTypeRequired
appIdApp ID received from Predis.ai account.Stringyes
embedTokenA token generated with the provided SSO key to enable Single Sign-onStringno
customAssetsAn array of objects with image URLs. If passed in the config, these images show up in the post generation flow and can be used to generate a post.Arrayno
modeIf you pass "window.Predis.modes.SIMPLE", the popup only show the create flow and library view. This is ideal for most use cases. Passing "window.Predis.modes.DETAILED" will show the more product features like Competitor analysis, Idea Labs etc. This is defaulted to "window.Predis.modes.SIMPLE".Stringno
brandDetails.nameName associated with the brand. This will show up on the UI In places where brand name is shown.Stringno
brandDetails.logo_urlLogo associated with the brand. This will show up on the UI In places where brand name is shown.Stringno
brandDetails.brand_hashtagsThese hashtags will be appended to the AI generated caption. You can use it to add any text if needed.Stringno
brandDetails.brand_websiteThe Brand website will be shown on AI-generated creatives. This is shown only if the design has space for website text.Stringno
brandDetails.brand_handleThe Brand handle will be shown on AI-generated creatives. This is shown only if the design has space for the handle name text.Stringno
brandDetails.brand_colorsThe AI-generated creatives will be generated using these colors. Maximum 5 colors can be passed hereArrayno
show_onboardingPass this as true if you want users to experience the onboarding flow when they use the SDK for the 1st time.booleanno
whiteLabelLogoPass your logo URL to replace Predis.ai Logo in the SDK. This will take effect only with the Whitelabel SDK Addon available in the SDK pricing.Stringno